//
//  MainNavTabViewController.m
//  Jyxt
//
//  Created by 刘日 on 17/5/5.
//  Copyright © 2017年 DaLian Rental Housing Management. All rights reserved.
//

#import "MainNavTabViewController.h"

@interface MainNavTabViewController ()

@end

@implementation MainNavTabViewController

- (void)initView{
    NSArray<NSString *> *names = @[@"infoGrab" , @"infoSearch" , @"message" , @"my"];
    NSArray<NSString *> *titles = @[@"信息采集",@"信息查询",@"居住证管理",@"我的"];
    for (NSInteger i = 0 ; i < names.count ; i ++){
        UIViewController *vc = [LKInstance findViewControllerInStoryboardWithKey: [NSString stringWithFormat: @"m_%@" , names[i]]];
        if (i == 2) {
            
            vc = [LKInstance findViewController:@"PoliceResidencePermitViewController"];
        }
        [self.lkTabBarController addChildViewController: vc];
        vc.title = titles[i];
        vc.tabBarItem.image = LKImageNamedNoRenderTintColor(([NSString stringWithFormat: @"m_tab_%@", names[i]]));
        vc.tabBarItem.selectedImage = LKImageNamedNoRenderTintColor(([NSString stringWithFormat: @"m_tab_%@_s", names[i]]));
    }
    [[UITabBarItem appearance] setTitleTextAttributes:@{NSForegroundColorAttributeName:[[ExtenColor colors] c_b3b3b3]} forState:UIControlStateNormal];
    [[UITabBarItem appearance] setTitleTextAttributes:@{NSForegroundColorAttributeName:[UIColor themeColor]} forState:UIControlStateSelected];
}

@end
